import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: () => import('@/views/error/NotFound.vue')
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'PermissionDenied',
      component: () => import('@/views/error/PermissionDenied.vue')
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'UserLogin',
      component: () => import('@/views/user/LoginView.vue')
    },
    {
      path: '/user',
      name: 'UserCenterView',
      component: () => import('@/views/user/UserCenterView.vue')
    },
    {
      path: '/user/login',
      name: 'UserLoginPage',
      component: () => import('@/views/user/LoginView.vue')
    },
    {
      path: '/user/wallet',
      name: 'UserWalletView',
      component: () => import('@/views/user/UserWalletView.vue')
    },
    {
      path: '/',
      name: 'home',
      component: () => import('@/views/HomeView.vue')
    },
    {
      path: '/message/my',
      name: 'MyMessageView',
      component: () => import('@/views/message/MyMessageView.vue')
    },
    {
      path: '/message/create',
      name: 'CreateMessage',
      component: () => import('@/views/message/CreateMessageView.vue')
    },
    {
      path: '/message/create/:user_id',
      name: 'CreateConsultMessage',
      component: () => import('@/views/message/CreateMessageView.vue')
    },
    {
      path: '/message/:id',
      name: 'MessageView',
      component: () => import('@/views/message/MessageView.vue')
    },
    {
      path: '/topic/my',
      name: 'MyTopicView',
      component: () => import('@/views/topic/MyTopicView.vue')
    },
    {
      path: '/topic/list',
      name: 'TopicListView',
      component: () => import('@/views/topic/TopicView.vue')
    },
    {
      path: '/topic/create',
      name: 'TopicCreateView',
      component: () => import('@/views/topic/CreateTopicView.vue')
    },
    {
      path: '/topic/:id',
      name: 'TopicDetailView',
      component: () => import('@/views/topic/TopicDetailView.vue')
    }
  ]
})

export default router
